<h2>ประเภทข้อมูล</h2>
<form>
<fieldset>
	<legend><strong>ค้นหา</strong></legend>
		<div>ชื่อรายการ         : <input type="text" name="search" value="<?=@$_GET['search'];?>" size="40">	
	<input type="submit" name="submit" value="Search"></div> 	
</div> 
</fieldset>
</form>
<br>
<? if(permission($menu_id, 'canadd')!=''){ ?> 
<div id="btnBox" align="right"><a href="<?=$urlpage;?>/form" style="text-decoration:none;"><input type="button" class="ui-state-active ui-corner-all btnAdd" value="เพิ่มรายการ"></a></div>
<? } ?>   
<div id="paging" class="pagination">
<?php echo $pagination;?>
</div>
<div id="main-content">
	<table class="tbContainer">
		<tr>
			<td align="left">
				<table border="0" cellpadding="10" cellspacing="0" width="100%">
					<tr class="ui-state-error">
						<td class="ui-state-error tdlist">ลำดับ</td>
						<td class="ui-state-error tdlist">ประเภทข้อมูล</td>
						<td class="ui-state-error tdlist">จัดการข้อมูล</td>
					</tr>
					<?php 
					  $rowStyle = '';
					  $page = (isset($_GET['page']))? $_GET['page']:1;
					  $i=(isset($_GET['page']))? (($_GET['page'] -1)* 10)+1:1;
					  foreach($dataList as $row):
					?>  
					<tr  <? if($rowStyle =='')$rowStyle = 'class="odd"';else $rowStyle = "";echo $rowStyle;?> >
					  <td class="tdlist"><?=$i;?></td>
					  <td class="tdlist" style="cursor: pointer;" align="left" onclick="window.location='<?=$urlpage;?>/form/<?=$row['id'];?>'"><?=$row['title'];?></td>		  
					  <td class="tdlist">
					  	<? if(permission($menu_id, 'candelete')!=''){ ?>
					  	<a href="<?=$urlpage;?>/delete/<?php echo $row['id']?>" style="text-decoration:none;" onclick="return confirm('<?php echo NOTICE_CONFIRM_DELETE?>')"><input type="button" class="btn_delete" /></a>
					  	<? } ?>  	
					  </td>
					  </tr>		
							<? 
							$i++;
					  		endforeach; 
							?>		
				</table>
			</td>
		</tr>
	</table>
</div>